using UnityEngine;
using UnityEngine.UI;
using Utils;

public class SmallMapBase : MonoBehaviour
{
    // private static Color[] colors = {Color.white, Color.green,};
    
    private Image[] images;
    private int prev = 0;
    
    private void Awake()
    {
        images = UITool.GetChildGameObject("SmallMap",gameObject).GetComponentsInChildren<Image>(true);
    }

    public void ChangeColorByIndex(int next)
    {
        images[prev].color = Color.white;
        images[next].color = Color.green;
        images[next].enabled = true;
        prev = next;
    }

    public void ResetSmallMap()
    {
        foreach (var image in images)
        {
            image.enabled = false;
        }
    }
}